const ParamsFactory = require("../utils/formateReturn");
const auth = (req, res, next) => {
    if (req.session.user == null) {
        return res.status(401).json({
            code: 401,
            msg: "Unauthorized",
            data: null,
        });
    }
    // 验证通过，重新设置session有效时间
    req.session.date = new Date();
    next();
};

module.exports = auth;
